package com.lianrui.app.order.domain;

import java.util.List;

import javax.persistence.Table;

import com.lianrui.app.member.domain.Member;
import com.lianrui.app.order.services.OrderStatus;
import com.lianrui.core.Domain;

/**
 * 功能描述：订单实体
 *
 * @author LJQ
 *
 * 2015年12月20日 上午9:10:52
 */
@Table(name = "es_order")
public class Order extends Domain<Integer> {

	private static final long serialVersionUID = 1L;

	@Override
	public Integer getId() {
		return order_id;
	}

	@Override
	public void setId(Integer id) {
		order_id = id;
	}
	
	private Integer order_id;

	private String sn;

	private Integer member_id;

	//订单状态，0-未付款，1-已付款，2-已发货，3-完成，4-作废，5-已受理，6-部分支付
	// 7-退款中，9-汇款待确认，-1退款，-2退货，-3申请退货，-4申请换货，-5退货被拒绝，-6换货被拒绝，-7已换货	
	private Integer status;

	//0-未支付，1-已支付，2-已退款，3-部分退款，4-部分支付
	private Integer pay_status;

	//0-未发货，1-已发货，2-已退货，3-部分退货，4-部分发货，5-部分换货，6-已换货
	private Integer ship_status;

	//状态显示字串
	private String shipStatus;
	
	private String payStatus;
	
	//收货地区id三级省市的最后一级
	private Integer regionid;
	
	private Integer shipping_id;

	private String shipping_type;

	private String shipping_area;

	private String goods;

	private Long create_time;

	private String ship_name;

	private String ship_addr;

	private String ship_zip;

	private String ship_email;

	private String ship_mobile;

	private String ship_tel;

	private String ship_day;

	private String ship_time;

	private Integer is_protect;

	private Double protect_price;

	private Double goods_amount;

	private Double shipping_amount;
	
	private Double discount; //优惠金额
	
	private Double order_amount;

	private Double weight;

	private Double paymoney;

	private String remark;

	private Integer disabled;

	private Integer payment_id;
	
	private String payment_name;
	
	private String payment_type;
	
	private String defaultbank;//网银支付时，银行类型
	
	private String swiftNumber;//银行转账支付时，流水号

	private Integer goods_num;
	
	private int gainedpoint;
	
	private int consumepoint;
	
	private long complete_time;

	//增加案件编号字段
	private String caseid;

	//文件name属性
	private String order_file;

	private int invoice_type; //发票类型 1 个人 2 企业

	private String invoice_title; //发票抬头

	private Double invoice_amount;//发票金额
	
	//文件name属性
	/**
	 * 标记是发票状态
	 */
	private Integer is_issued;
	
/*	private String uname;
	private String mobile;*/
	private Integer payLogStatus;
	
	private Long payCreate_time;
	
	private Long subject_id;
	
	private Member member;
	
	private List<OrderItem> items;

	public Long getSubject_id() {
		return subject_id;
	}

	public void setSubject_id(Long subject_id) {
		this.subject_id = subject_id;
	}

	public Integer getPayLogStatus() {
		return payLogStatus;
	}

	public void setPayLogStatus(Integer payLogStatus) {
		this.payLogStatus = payLogStatus;
	}

	public Long getPayCreate_time() {
		return payCreate_time;
	}

	public void setPayCreate_time(Long payCreate_time) {
		this.payCreate_time = payCreate_time;
	}

	public Double getInvoice_amount() {
		return invoice_amount;
	}

	public void setInvoice_amount(Double invoice_amount) {
		this.invoice_amount = invoice_amount;
	}

	public int getInvoice_type() {
		return invoice_type;
	}

	public void setInvoice_type(int invoice_type) {
		this.invoice_type = invoice_type;
	}

	public String getInvoice_title() {
		return invoice_title;
	}

	public void setInvoice_title(String invoice_title) {
		this.invoice_title = invoice_title;
	}

	public String getOrder_file() {
		return order_file;
	}

	public void setOrder_file(String order_file) {
		this.order_file = order_file;
	}

	public String getCaseid() {
		return caseid;
	}

	public void setCaseid(String caseid) {
		this.caseid = caseid;
	}


	public long getComplete_time() {
		return complete_time;
	}

	public void setComplete_time(long complete_time) {
		this.complete_time = complete_time;
	}

	public Integer getGoods_num() {
		return goods_num;
	}

	public void setGoods_num(Integer goodsNum) {
		goods_num = goodsNum;
	}

	public Long getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Long create_time) {
		this.create_time = create_time;
	}

	public String getGoods() {
		return goods;
	}

	public void setGoods(String goods) {
		this.goods = goods;
	}

	public Double getGoods_amount() {
		return goods_amount;
	}

	public void setGoods_amount(Double goods_amount) {
		this.goods_amount = goods_amount;
	}

	public Integer getIs_protect() {
		is_protect =is_protect==null?0:is_protect;
		return is_protect;
	}

	public void setIs_protect(Integer is_protect) {
		this.is_protect = is_protect;
	}

	public Integer getMember_id() {
		return member_id;
	}

	public void setMember_id(Integer member_id) {
		this.member_id = member_id;
	}

	public Double getOrder_amount() {
		return order_amount;
	}

	public void setOrder_amount(Double order_amount) {
		this.order_amount = order_amount;
	}

	public Integer getOrder_id() {
		return order_id;
	}

	public void setOrder_id(Integer order_id) {
		this.order_id = order_id;
	}

	public Integer getPay_status() {
		return pay_status;
	}

	public void setPay_status(Integer pay_status) {
		this.pay_status = pay_status;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getShip_addr() {
		return ship_addr;
	}

	public void setShip_addr(String ship_addr) {
		this.ship_addr = ship_addr;
	}

	public String getShip_day() {
		return ship_day;
	}

	public void setShip_day(String ship_day) {
		this.ship_day = ship_day;
	}

	public String getShip_email() {
		return ship_email;
	}

	public void setShip_email(String ship_email) {
		this.ship_email = ship_email;
	}

	public String getShip_mobile() {
		return ship_mobile;
	}

	public void setShip_mobile(String ship_mobile) {
		this.ship_mobile = ship_mobile;
	}

	public String getShip_name() {
		return ship_name;
	}

	public void setShip_name(String ship_name) {
		this.ship_name = ship_name;
	}

	public Integer getShip_status() {
		return ship_status;
	}

	public void setShip_status(Integer ship_status) {
		this.ship_status = ship_status;
	}

	public String getShip_tel() {
		return ship_tel;
	}

	public void setShip_tel(String ship_tel) {
		this.ship_tel = ship_tel;
	}

	public String getShip_time() {
		return ship_time;
	}

	public void setShip_time(String ship_time) {
		this.ship_time = ship_time;
	}

	public String getShip_zip() {
		return ship_zip;
	}

	public void setShip_zip(String ship_zip) {
		this.ship_zip = ship_zip;
	}

	public Double getShipping_amount() {
		return shipping_amount;
	}

	public void setShipping_amount(Double shipping_amount) {
		this.shipping_amount = shipping_amount;
	}

	public String getShipping_area() {
		return shipping_area;
	}

	public void setShipping_area(String shipping_area) {
		this.shipping_area = shipping_area;
	}

	public Integer getShipping_id() {
		return shipping_id;
	}

	public void setShipping_id(Integer shipping_id) {
		this.shipping_id = shipping_id;
	}

	public String getShipping_type() {
		return shipping_type;
	}

	public void setShipping_type(String shipping_type) {
		this.shipping_type = shipping_type;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	public Double getProtect_price() {
		return protect_price;
	}

	public void setProtect_price(Double protect_price) {
		this.protect_price = protect_price;
	}

	public Integer getDisabled() {
		return disabled;
	}

	public void setDisabled(Integer disabled) {
		this.disabled = disabled;
	}

	public Integer getPayment_id() {
		return payment_id;
	}

	public void setPayment_id(Integer payment_id) {
		this.payment_id = payment_id;
	}

	public String getPayment_name() {
		return payment_name;
	}

	public void setPayment_name(String payment_name) {
		this.payment_name = payment_name;
	}

	public Double getPaymoney() {
		return paymoney;
	}

	public void setPaymoney(Double paymoney) {
		this.paymoney = paymoney;
	}

	public int getGainedpoint() {
		return gainedpoint;
	}

	public void setGainedpoint(int gainedpoint) {
		this.gainedpoint = gainedpoint;
	}

	public int getConsumepoint() {
		return consumepoint;
	}

	public void setConsumepoint(int consumepoint) {
		this.consumepoint = consumepoint;
	}

	public Integer getRegionid() {
		return regionid;
	}

	public void setRegionid(Integer regionid) {
		this.regionid = regionid;
	}

	public String getShipStatus() {
		//0-未发货，1-已发货，2-已退货，3-部分退货，4-部分发货，5-部分换货，6-已换货
		if(ship_status==OrderStatus.SHIP_NO)shipStatus="未发货";
		if(ship_status==OrderStatus.SHIP_YES)shipStatus="已发货";
		if(ship_status==OrderStatus.SHIP_CANCEL)shipStatus="已退货";
		if(ship_status==OrderStatus.SHIP_PARTIAL_CANCEL)shipStatus="部分退货";
		if(ship_status==OrderStatus.SHIP_PARTIAL_SHIPED)shipStatus="部分发货";
		if(ship_status==OrderStatus.SHIP_PARTIAL_CHANGE)shipStatus="部分换货";
		if(ship_status==OrderStatus.SHIP_CHANED)shipStatus="已换货";

		return shipStatus;
	}

	public void setShipStatus(String shipStatus) {
		this.shipStatus = shipStatus;
	}

	public String getPayStatus() {
		//0-未支付，1-已支付，2-已退款，3-部分退款，4-部分支付
		if(pay_status==OrderStatus.PAY_NO)payStatus="未支付";
		if(pay_status==OrderStatus.PAY_YES)payStatus="已支付";
		if(pay_status==OrderStatus.PAY_CANCEL)payStatus="已退款";
		if(pay_status==OrderStatus.PAY_PARTIAL_REFUND)payStatus="部分退款";
		if(pay_status==OrderStatus.PAY_PARTIAL_PAYED)payStatus="部分支付";

		return payStatus;
	}

	public void setPayStatus(String payStatus) {
		this.payStatus = payStatus;
	}

	public String getStatusZH() {
		return OrderStatus.getStatusZH(status);
	}

	public String getPayment_type() {
		return payment_type;
	}

	public void setPayment_type(String paymentType) {
		payment_type = paymentType;
	}

	public Double getDiscount() {
		return discount;
	}

	public void setDiscount(Double discount) {
		this.discount = discount;
	}

	public String getDefaultbank() {
		return defaultbank;
	}

	public void setDefaultbank(String defaultbank) {
		this.defaultbank = defaultbank;
	}

	public String getSwiftNumber() {
		return swiftNumber;
	}

	public void setSwiftNumber(String swiftNumber) {
		this.swiftNumber = swiftNumber;
	}

	public Integer getIs_issued() {
		return is_issued;
	}

	public void setIs_issued(Integer is_issued) {
		this.is_issued = is_issued;
	}

	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public List<OrderItem> getItems() {
		return items;
	}

	public void setItems(List<OrderItem> items) {
		this.items = items;
	}
	
}
